#ifndef _LIST_
#define _LIST_

#include <stdlib.h>

typedef struct list_data *list;

typedef enum boolean {false=0,true} bool;

typedef int element_t;


list create(void);
/*this fuction creates a lst an dreturns it*/
/*in case of failure returns NULL*/

unsigned int size(list target_list);
/*this fuction returns the list's size*/

bool empty(list target_list);
/*this fuction returns true if the target_list is empty*/
/*else returns false*/

void clear(list target_list);
/*this fuction clears the given list*/

void delete(list target_list);
/*this fuction deletes the given list*/


bool push(list target_list, unsigned int pos, element_t data);
/*this fuction pushes the data in the target_list in the pos node*/
/*in case of failure returns false*/


bool pop(list target_list, unsigned int pos);
/*this fuction pops the pos node*/
/*in case of failure returns false*/


int search(list target_list, element_t data);
/*this fuction searches the list for the data element returns the node the element appears*/
/*the element doesn't exist returns 0*/


unsigned int count(list target_list, element_t data);
/*this fuction returns how many times the data apears in the target_list*/


unsigned int remove_data(list target_list, element_t data);
/*this fuction removes the data from the list*/
/*returns how nodes poped from the list*/


list copy(list target_list, unsigned int pos, unsigned int number); 
/*this fuction copies starting from the pos node continuing for number nodes in a list and returns the list*/
/*in case of failure returns NULL*/


list extract(list target_list, unsigned int pos, unsigned int number);
/*this fuction extracts the number nodes from the target_list and puts them in a list, which also returns*/
/*in case of failure returns NULL*/


bool insert(list target_list, list source_list, unsigned int pos);
/*this fuction inserts the source list in the target in the pos node*/
/*in case of failure returns NULL*/


void append(list target_list, list source_list);
/*this fuction appends the target_list in the source list*/
/*in case of failure returns false*/


bool merge(list target_list, list source_list);
/*this fuction merges the given lists*/
/*in case of failure returns false*/


void sort(list target_list);
/*this fuction sorts the given list*/ 


unsigned int unique(list target_list);
/*this fuction pops the same continuing elements*/
/*returns how nodes poped*/


void reverse(list target_list);
/*this fuction reverses the given list*/


void fill(list target_list, element_t data);
/*this fuction fill the list with the data*/


#endif
